/*
 * Copyright (C) 2018 Donlon.
 *
 * 2018秋季C语言练习题（4）
 * http://10.105.242.83/contest/484/
 *
 * C. 打印图形
 */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main() {
  char type[16];
  int h;
  scanf("%s %d", type, &h);

  if (strcmp(type, "triangle") == 0) {

    for (int i = 0; i < h; i++) {
      int w = h - abs(2 * i - (h - 1));
      for (int j = 0; j < w; j++) {
        putchar('*');
      }
      putchar('\n');
    }

  } else {

    for (int i = 0; i < h; i++) {
      int w = h - abs(i - (h - 1) / 2);
      for (int j = 0; j < w; j++) {
        putchar(j < abs(i - (h - 1) / 2) ? ' ' : '*');
      }
      putchar('\n');
    }
  }
}